#include <fstream>
#include <iostream>
struct Paramaters
{
	bool	bLogToScreen;
	Logger* pERRLOGGER;
	Logger* pLOGGER;


	std::string	ReqFile;
	std::string ResFile;

	std::string ErrFile;
	std::string LogFile;

} params ;


std::fstream ErrStream;
std::fstream LogStream;


void Init( ConfigFile& cfg )
{


	std::string Key		= "ReqFile";
	std::string Default	= "NONE";

	Key		= "ReqFile";
 	params.ReqFile	= cfg.getValueOfKey( Key, Default );

	Key		= "ReqFile";
	Default	= "NONE";

 	Key		= "ResFile";
 	params.ResFile	= cfg.getValueOfKey( Key, Default );

 	Key = "ErrFile";
 	params.ErrFile	= cfg.getValueOfKey( Key, Default );

 	Key = "LogFile";
 	params.LogFile =  cfg.getValueOfKey( Key, Default );


 	Key = "LogToScreen";
 	bool bDefault = true;
 	params.bLogToScreen =  cfg.getValueOfKey( Key, bDefault );


 	std::cout<<"ErrFile "<<params.ErrFile<<"\n";
 	ErrStream.open( params.ErrFile.c_str() , std::fstream::out | std::fstream::in );

 	std::cout<<"LogFile "<<params.LogFile<<"\n";
 	LogStream.open( params.LogFile.c_str() , std::fstream::out | std::fstream::in  );

	params.pLOGGER		= new Logger( LogStream , 1 , params.bLogToScreen );
	params.pERRLOGGER	= new Logger( ErrStream , 1 , params.bLogToScreen );

 	if( ErrStream.good( ) )
 	{
 		*(params.pLOGGER)<<"Starting Error file \n";
 	}
 	else
 	{
 		std::cerr<<"Couldn't open error file\n";
 	}

 	if( LogStream.good( ) )
 	{
 		*(params.pLOGGER)<<"Star Logging\n	";
 	}
 	else
 	{
 		std::cerr<<"Couldn't open log file\n";
 	}


};
